package com.tt.lcd.qunyangGPRS.utils;

import com.tt.lcd.qunyangGPRS.aSDK.SDKserver;

public class Register {
	private static Register register;

	public SDKserver server;

	private Register() {
	}

	public static Register getRegister() {
		if (register == null) {
			register = new Register();
		}
		return register;
	}

	/**
	 * byte的原码值
	 * @param i
	 * @return
	 */
	public static int getInt(byte i) {
		int g1 = i & 127;
		if (i < 0) {
			g1 = g1 + 128;
		}
		return g1;
	}
	/**
	 * byte数组转int数组
	 * @param i
	 * @return
	 */
	public static int[] getInts(byte i[]) {
		int[] c = new int[i.length];
		for (int j = 0; j < c.length; j++) {
			c[j] = getInt(i[j]);

		}
		return c;
	}
}
